#!/usr/bin/env bash
# running regression tests

TESTS="defconfig test1 test2"
INCLUDES="../metapascal/main.m4"

FAILED=0

for t in $TESTS ; do
    m4 -g $INCLUDES $t.pas4 > $t.new
    touch $t.can
    diff $t.can $t.new > $t.diff
    if [ -s $t.diff ] ; then
        echo "=============== $t failed ===============" 2>&1
        cat $t.diff 2>&1
        FAILED=1
    fi
done

exit $FAILED
